﻿using NetDon.OA.Business.Admin;
using NetDon.OA.Business.CRM;
using NetDon.OA.Business.Common;
using NetDon.OA.Business.Location;
using NetDon.OA.Business.eLogitics;
using NetDon.OA.Interface;
using NetDon.OA.Interface.Admin;
using NetDon.OA.Interface.CRM;
using NetDon.OA.Interface.Common;
using NetDon.OA.Interface.eLogistics;
using NetDon.Utilities;

namespace NetDon.OA.Business
{
    public static class ServiceBuilder
    {
        public static void AddServices()
        {
            object companyService = Memoizer.CreateProxy<CompanyService>();
            ServiceContainer.AddService((ICompanyService)companyService);

            object securityService = Memoizer.CreateProxy<SecurityService>();
            ServiceContainer.AddService((ISecurityService)securityService);
            ServiceContainer.AddService((ISecurityManageService)securityService);

            object dictionaryService = Memoizer.CreateProxy<DictionaryService>();
            ServiceContainer.AddService((IDictionaryService)dictionaryService);
            ServiceContainer.AddService((IDictionaryManageService)dictionaryService);

            object departmentService = Memoizer.CreateProxy<DepartmentService>();
            ServiceContainer.AddService((IDepartmentService)departmentService);

            object configurationService = Memoizer.CreateProxy<ConfigurationService>();
            ServiceContainer.AddService((IConfigurationService)configurationService);
            ServiceContainer.AddService((IConfigurationManageService)configurationService);

            object logService = Memoizer.CreateProxy<LogService>();
            ServiceContainer.AddService((ILogService)logService);
            object postService = Memoizer.CreateProxy<PostService>();
            ServiceContainer.AddService((IPostService)postService);

            object userService = Memoizer.CreateProxy<UserService>();
            ServiceContainer.AddService((IUserService)userService);

            object locationService = Memoizer.CreateProxy<LocationService>();
            ServiceContainer.AddService((ILocationService)locationService);
            //
            ICustomerInfoService customerInfoService = Memoizer.CreateProxy<CustomerInfoService>();
            ServiceContainer.AddService(customerInfoService);

            IAttachmentService attachmentService = Memoizer.CreateProxy<AttachmentService>();
            ServiceContainer.AddService(attachmentService);

            IVehicleModelService vehicleModelService = Memoizer.CreateProxy<VehicleModelService>();
            ServiceContainer.AddService(vehicleModelService);

            IRouteInfoService routeInfoService = Memoizer.CreateProxy<RouteInfoService>();
            ServiceContainer.AddService(routeInfoService);

            IShuntingCostConfigService shuntingCostConfigService = Memoizer.CreateProxy<ShuntingCostConfigService>();
            ServiceContainer.AddService(shuntingCostConfigService);
            IGoodsTravelDaysConfigService goodsTravelDaysConfigService = Memoizer.CreateProxy<GoodsTravelDaysConfigService>();
            ServiceContainer.AddService(goodsTravelDaysConfigService);

            IIssuingOrderService issuingOrderService = Memoizer.CreateProxy<IssuingOrderService>();
            ServiceContainer.AddService(issuingOrderService);

            IIssuingOrderOnWayTrackService issuingOrderOnWayTrackService = Memoizer.CreateProxy<IssuingOrderOnWayTrackService>();
            ServiceContainer.AddService(issuingOrderOnWayTrackService);


            IIssuingOrderReceiptInfoTrackService issuingOrderReceiptInfoTrackService = Memoizer.CreateProxy<IssuingOrderReceiptInfoTrackService>();
            ServiceContainer.AddService(issuingOrderReceiptInfoTrackService);


            IMachineAccountService machineAccountService = Memoizer.CreateProxy<MachineAccountService>();
            ServiceContainer.AddService(machineAccountService);

            IRevenueMachineAccountService revenueMachineAccountService = Memoizer.CreateProxy<RevenueMachineAccountService>();
            ServiceContainer.AddService(revenueMachineAccountService);


            IReportQueryService reportQueryService = Memoizer.CreateProxy<ReportQueryService>();
            ServiceContainer.AddService(reportQueryService);
        }


        public static void RemoveServices()
        {
            ServiceContainer.RemoveService<ICompanyService>();
            ServiceContainer.RemoveService<IDepartmentService>();
            ServiceContainer.RemoveService<ISecurityService>();
            ServiceContainer.RemoveService<IDictionaryService>();
            ServiceContainer.RemoveService<IConfigurationService>();
            ServiceContainer.RemoveService<IConfigurationManageService>();
            ServiceContainer.RemoveService<ILogService>();
       
            ServiceContainer.RemoveService<IPostService>();
            ServiceContainer.RemoveService<ILocationService>();
            ServiceContainer.RemoveService<IUserService>();


            ServiceContainer.RemoveService<IVehicleModelService>();
            ServiceContainer.RemoveService<IRouteInfoService>();
            ServiceContainer.RemoveService<IShuntingCostConfigService>();
            ServiceContainer.RemoveService<IGoodsTravelDaysConfigService>();


            ServiceContainer.RemoveService<ICustomerInfoService>();
         
            ServiceContainer.RemoveService<IAttachmentService>();

            ServiceContainer.RemoveService<IIssuingOrderService>();
            ServiceContainer.RemoveService<IIssuingOrderOnWayTrackService>();
            ServiceContainer.RemoveService<IIssuingOrderReceiptInfoTrackService>();

            ServiceContainer.RemoveService<IMachineAccountService>();
            ServiceContainer.RemoveService<IRevenueMachineAccountService>();

            ServiceContainer.RemoveService<IReportQueryService>();
 
        }

       
    }
}